package com.gubei.subject.common.enums;

import lombok.Getter;

/**
 * 題目タイプのEnum定義
 */
@Getter
public enum SubjectInfoTypeEnum {

    RADIO(1,"単一選択問題"),
    MULTIPLE(2,"多選択問題"),
    JUDGE(3,"判断問題"),
    BRIEF(4,"解答問題");

    public int code;
    public String desc;

    SubjectInfoTypeEnum(int code, String desc){
        this.code = code;
        this.desc = desc;
    }

    public static SubjectInfoTypeEnum getByCode(int codeVal){
        for(SubjectInfoTypeEnum resultEnum : SubjectInfoTypeEnum.values()){
            if(resultEnum.code == codeVal){
                return resultEnum;
            }
        }
        return null;
    }
}
